<?php
/**
 * /nmox/main/static.php
 * A collection of static functions for use throughout NMOX Server
 * 
 * @author David Christian Liedle <david.liedle@gmail.com>
 * @link   http://nmox.org/
 *
 */

function goblin($file){
	// THIS IS A BAD WAY
	// global in
	if( require_once($file) ){
	
		return TRUE;
	
	} else {
	
		return FALSE;
	
	}

}

function infinite_array($array){
    // unload recursively
    
    $ret_this = null;
    
    if( is_array($array) ){
        
        foreach( $array as $key=>$value ){
            if( is_array($value) ){
                $ret_this .= infinite_array($value);
            } else {
                $ret_this .= $value;
            }
        }
        
    } else {
        
        $ret_this .= $array;
        
    }
    return $ret_this;
}

function locateMe($im="Default", $type=FALSE){
	global $test_locations;
    if( $type ){
        //
    } else {
        //
    }
    $test_locations .= "<small><b>$im:</b> <i>included</i></small><br />\n";
}

function oneShot($shooter){

	echo $shooter."<br />\n";

}
function redirect($where_to){
    header("Location: ".$where_to);
}
function testStatic(){

	return "You've got static!";

}

################################################################################
# Just for kicks, to watch the chain:
#
locateMe("/nmox/main/static.php");
